;(function($){
  //适用于区域和区域的组织机构部门的级联
  window.areaDept = {
    initAreaDom : function(options){
      options = (options) ? options : {method:'GET',param:['area_id']};
      var url = options.url || '';//必填
      var method = options.method || 'GET';
      var enable = options.enable || false;
      var p = options.p || false;
      var param = options.param || ['area_id'];//自动传递到后端的key,此key后端必须有返回,其中的area_id是原始的区域主键,kid是导入到本平台系统后新生成的主键
      var callback = options.callback;//必填,回调,是对象格式-> callback : {beforeClick : function(){},onClick : function(event,treeId,node){}}
      var areaClick = options.areaClick || null;//点击区域的输入框事件
      var dataFilter = options.dataFilter || null;//仅在code != 200时有效
      if(areaClick){
        areaClick();
      }
      return {
        view : zTreeOpts.view(),
        check : zTreeOpts.check({enable:enable,p:p}),
        data : zTreeOpts.data(),
        async : zTreeOpts.async({
          url : url,
          method : method,
          param : param,
          tips : true,
          dataFilter : dataFilter
        }),
        callback : callback
      }
    },
    initRelevance : function(options){//点击勾选或取消时子节点不受联动或点击子节点时父节点不受联动
      options = (options) ? options : {method:'GET',param:['kid']};
      var url = options.url || '';//必填
      var method = options.method || 'GET';
      var param = options.param || ['kid'];//自动传递到后端的key,此key后端必须有返回,其中的area_id是原始的区域主键,kid是导入到本平台系统后新生成的主键
      var callback = options.callback;//必填,回调,是对象格式-> callback : {beforeClick : function(){},onClick : function(event,treeId,node){}}
      var dataFilter = options.dataFilter || null;//仅在code != 200时有效
      return {
        view : zTreeOpts.view(),
        check : {
          enable: true,
          chkStyle: "checkbox",
          chkboxType: {"Y":"","N":""}//点击勾选或取消时子节点不受联动或点击子节点时父节点不受联动
        },
        data : zTreeOpts.data(),
        async : zTreeOpts.async({
          url : url,
          method : method,
          param : param,
          tips : true,
          dataFilter : dataFilter
        }),
        callback : callback
      }
    }
  }
})(jQuery);